package com.balabala.gym_enum;

/**
 * @Author 何涛
 * @Date: 2023/04/28/ 13:03
 * @description 常用异常信息枚举
 */
public enum ExceptionEnum {
    GENERALLY_FAIL(460, "失败"),
    PHONE_ILLEGAL(451, "电话号码不合法"), NOT_HAS_USER(452, "没有这个用户"), RE_LOGIN(453, "重新登录"),
    FAIL_WX_LOGIN(454, "微信授权登录失败"), REQUEST_FAIL(455, "请求失败"), TOKEN_EXPIRE(456, "token已失效"), TOKEN_ILLEGAL(457, "token不合法"),
    NOT_HAS_TOKEN(458, "请求头没有携带token"), NOT_HAS_CAPTCHA(447, "验证码失效或不存在验证码"),
    ACCOUNT_BAN(449, "账户被禁用"), NOT_KNOW_EXCEPTION(450, "未知异常"),
    NO_CACHE_DATA(445, "缓存中没有数据，并且数据库也没有"), NULL_PHONE(446, "电话号码不能为空"), SMS_CODE_ILLEGAL(447, "验证码不合法"), SMS_CODE_ERROR(448, "验证码不正确"), SAVE_DEFAULT_USER(449, "保存默认用户失败"),
    INCONSISTENT_PASSWORD_INPUT(20001, "两次输入密码不一致"),
    USERNAME_HAS_USED(20002, "用户名已经被使用"),
    EMAIL_HAS_USED(20003, "邮箱已经被使用"),
    PHONE_HAS_USED(20004, "手机号已经被使用"),
    ADMIN_NO_EXIST(20005, "用户名不存在"),
    PASSWORD_ADMIN_ERROR(20006, "密码错误"),
    MORE_THAN_PEOPLE(20007, "超过人数"),
    ILLEGAL_EXTNAME(4444,"文件扩展名不合法" ),
    UPLOAD_IMAGE_FAIL(4445,"上传图片失败" ), REPEAT_SUBMIT_ORDER(4446,"重复提交订单" ),
    PRICE_NOT_RIGHT(4447,"商品价格有变动，请重新提交当你孤单" ), NO_LOCK_STOCK(4448,"没有要锁定的库存" ),
    NO_PAYMENT_STATUS(4449,"不是待支付状态，无法取消！" ), NOT_HAS_ORDER(4450,"订单不存在" ),
    NOT_DELETE_ORDER(4451,"订单删除失败，订单需要处于取消状态才可以" );


    private Integer code;
    private String msg;

    ExceptionEnum(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }
}
